import { createRouter, createWebHashHistory } from 'vue-router'
import DispatchCommand from '@/views/DispatchCommand.vue'
import PredictionWarning from '@/views/PredictionWarning.vue'

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/',
    component: () => import('../views/index/index.vue'),
    children: [
      {
        path: '',
        component: () => import('../views/CenterLayout/index.vue'),
        children: [
          {
            path: 'index',
            name: 'index',
            components: {
              left: () => import('../views/HomePage/LeftIndex.vue'),
              right: () => import('../views/HomePage/RightIndex.vue'),
            }
          }
        ]
      },
      {
        path: 'ecological-dispatching',
        name: 'ecological-dispatching',
        component: ()=>import('../views/EcologicalDispatching')
      },
            {
        path: 'intelli-sense',
        name: 'intelli-sense',
        component: ()=>import('../views/IntelliSense/index.vue')
      },
      {
        path: 'dispatch-command',
        name: 'dispatch-command',
        component: DispatchCommand
      },
      {
        path: 'prediction-warning',
        name: 'prediction-warning',
        component: PredictionWarning
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
